package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.AtmCassetteMapper;
import com.zone.service.domain.AtmCassette;
import com.zone.service.service.IAtmCassetteService;

/**
 * ATM钞箱管理Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-30
 */
@Service
public class AtmCassetteServiceImpl implements IAtmCassetteService 
{
    @Autowired
    private AtmCassetteMapper atmCassetteMapper;

    /**
     * 查询ATM钞箱管理
     * 
     * @param id ATM钞箱管理主键
     * @return ATM钞箱管理
     */
    @Override
    public AtmCassette selectAtmCassetteById(Long id)
    {
        return atmCassetteMapper.selectAtmCassetteById(id);
    }

    /**
     * 查询ATM钞箱管理列表
     * 
     * @param atmCassette ATM钞箱管理
     * @return ATM钞箱管理
     */
    @Override
    public List<AtmCassette> selectAtmCassetteList(AtmCassette atmCassette)
    {
        return atmCassetteMapper.selectAtmCassetteList(atmCassette);
    }

    /**
     * 新增ATM钞箱管理
     * 
     * @param atmCassette ATM钞箱管理
     * @return 结果
     */
    @Override
    public int insertAtmCassette(AtmCassette atmCassette)
    {
        atmCassette.setCreateTime(DateUtils.getNowDate());
        return atmCassetteMapper.insertAtmCassette(atmCassette);
    }

    /**
     * 修改ATM钞箱管理
     * 
     * @param atmCassette ATM钞箱管理
     * @return 结果
     */
    @Override
    public int updateAtmCassette(AtmCassette atmCassette)
    {
        atmCassette.setUpdateTime(DateUtils.getNowDate());
        return atmCassetteMapper.updateAtmCassette(atmCassette);
    }

    /**
     * 批量删除ATM钞箱管理
     * 
     * @param ids 需要删除的ATM钞箱管理主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteByIds(Long[] ids)
    {
        return atmCassetteMapper.deleteAtmCassetteByIds(ids);
    }

    /**
     * 删除ATM钞箱管理信息
     * 
     * @param id ATM钞箱管理主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteById(Long id)
    {
        return atmCassetteMapper.deleteAtmCassetteById(id);
    }
    
    /**
     * 批量新增ATM钞箱管理
     * 
     * @param atmCassetteList ATM钞箱管理列表
     * @return 结果
     */
    @Override
    public int insertAtmCassetteList(List<AtmCassette> atmCassetteList)
    {
        int rows = 0;
        for (AtmCassette atmCassette : atmCassetteList) {
            atmCassette.setCreateTime(DateUtils.getNowDate());
            rows += atmCassetteMapper.insertAtmCassette(atmCassette);
        }
        return rows;
    }
    
    /**
     * 批量插入ATM钞箱数据
     *
     * @param atmCassetteList ATM钞箱列表
     * @return 结果
     */
    @Override
    public int batchInsertAtmCassette(List<AtmCassette> atmCassetteList) {
        return atmCassetteMapper.batchInsertAtmCassette(atmCassetteList);
    }
}